﻿using System.Runtime.Serialization;

namespace TripLOA.WebService.Serializable
{
    /// <summary>
    /// Class that represents a WebService error response
    /// </summary>
    [DataContract]
    public class WSError : WSObject
    {
        #region Constructors
        /// <summary>
        /// Parameterless Costructor. Set status to "fail"
        /// </summary>
        public WSError()
        {
            this.Status = "fail";
        }

        #endregion

        #region Properties
        /// <summary>
        /// Error code
        /// </summary>
        [DataMember]
        public ErrorType ErrorType { get; set; }

        /// <summary>
        /// Error description
        /// </summary>
        [System.Obsolete]
        [DataMember]
        public string ErrorDescription { get; set; }
        #endregion
    }

    public enum ErrorType{
        Generic = -1,
        Serialization = -2,
        InvalidMethod,
        MethodException,
        RequiredParameter,
        InvalidParameter = -6
    }
}
